package 复习;

public class DetractorA  extends  Observable{

    public DetractorA(double price,AbstractRole abstractRole) {
        /** 传入要被装饰的对象 **/

        super(abstractRole);
        this.setPrice(price);
    }

    @Override
    public double cost() {
        return super.getPrice()+getAbstractRole().cost();
    }
}
